package com.zhanglijie.base.threadPool;

import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;

/**
 * @author zhanglijie
 * @version 1.0
 * @since 1.1.0 2022/7/4 0004 23:41
 */
public class MyRejectionPolicy implements RejectedExecutionHandler {
    @Override
    public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
        if(!executor.isShutdown()) {
            new Thread(r,"自定义拒绝策略").start();
        }
    }
}
